<?php
/**
 * Created by PhpStorm.
 * User: Jack Liu
 * Date: 2019/7/24
 * Time: 11:03
 * Newrequest
 */
namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;

abstract class Request extends FormRequest
{
    protected function failedValidation(Validator $validator)
    {
        throw (new HttpResponseException(response()->json([
            'code' => 0,
            'msg' => $validator->errors()->first(),
            'info' => ""
        ], 200)));
    }

}